
<?php
	session_start();
	$referer = $_SERVER['HTTP_REFERER'];
	include_once("../DTO/sanPhamDTO.php");
	include_once("../BUS/sanPhamBUS.php");
	include_once("../DTO/cauHinhSPDTO.php");
	include_once("../BUS/cauHinhSPBUS.php");
	
	include_once("../BUS/cauHinhLoaiSPBUS.php");
	include_once("../DTO/cauHinhLoaiSPDTO.php");
	$idLoaiSP = $_POST['cmbLoaiSP'];
	
	
	echo $idLoaiSP;
	
	$sanPhamBUS = new sanPhamBUS();
		
	$arrSanPhamDTO = $sanPhamBUS->themSanPham();
	$idsp = $arrSanPhamDTO[0]->idSP;
	
	$cauHinhLoaiSPBUS = new cauHinhLoaiSPBUS();
	$arrCauHinhLoaiSPDTO = $cauHinhLoaiSPBUS->load_CauHinhLoaiSP_idLoaiSP($idLoaiSP);
	
	$cauHinhSPBUS = new cauHinhSPBUS();
	
	for($i =0; $i <count($arrCauHinhLoaiSPDTO); $i++)
	{
		$kq = $_POST["txt".$i];

		$arrcauHinhSPDTO = $cauHinhSPBUS->themCauHinhSP($idsp, $kq);
		
	}
	
	
	
	
	
	
	
	
	?>
	<h4>Thêm sản phẩm thành công.</h4>
    <h4><a href="../pages/index.php">Về Trang Chủ.</a></h4>	
	
